<?php
/**
 * TomatoCMS
 *
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 *
 * @copyright    Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license        http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version     $Id: Order.php 2793 2010-05-03 18:48:14Z huuphuoc $
 * @since        2.0.5
 */

interface Shop_Models_Interface_Order
{
    /**
    * Search for order by collection of conditions
    *
    * @param int $offset
    * @param int $count
    * @param array $exp Searching conditions. An array contain various conditions, keys including:
    * - order_id
    * - order_created_date
    * - order_modified_date
    * - order_status
    * - order_tracking_status
    * - keyword
    * @return Tomato_Core_Model_RecordSet
    */
    public function find($offset, $count, $exp = null);

    /**
    * Count the number of order by collection of conditions
    *
    * @param array $exp Searching conditions (@see find)
    * @return int
    */
    public function count($exp = null);

    /**
    * Update the order
    *
    * @param int $order_id Id of order
    * @param Tomato_Modules_Order_Models_Order $order
    * @return void
    */
    public function edit($order, $order_id);

    /**
    * Get order by id
    *
    * @param int $order_id
    * @return Tomato_Core_Model_RecordSet
    */
    public function getOrderById($order_id);

    /**
    * Get product info by order id
    *
    * @param int $order_id
    * @return Tomato_Core_Model_RecordSet
    */
    public function getProductById($order_id);

    /**
    * Get attribute type id by product id
    *
    * @param int $product_id
    * @return Tomato_Core_Model_RecordSet
    */
    public function getAttributeTypeIdByProductId($product_id);

    /**
    * Get attribute type
    *
    * @param int $id
    * @return Tomato_Core_Model_RecordSet
    */
    public function getAttributeType($id);

    /**
    * Get value type
    *
    * @param int $id
    * @return Tomato_Core_Model_RecordSet
    */
    public function getValue($id);

    /**
    * Update order detail
    *
    * @param array $orderDetail
    * @param int $order_detail_id
    * @return void
    */
    public function updateOrderDetail($orderDetail, $order_detail_id);

    public function updateOrderDetailCost($orderDetail, $order_detail_id);

    /**
    * Update order
    *
    * @param array $order
    * @param int $order_id
    * @return void
    */
    public function update($order, $order_id);

    /**
    * Update order
    *
    * @param array $order
    * @param int $order_id
    * @return void
    */
    public function updateTracking($order, $order_id);

    /**
    * Add order tracking
    *
    * @param void $order_tracking
    * @return int
    */
    public function addTracking($order_tracking);

    /**
    * Get list tracking
    *
    * @param int $order_id
    * @return Tomato_Core_Model_RecordSet
    */
    public function getTracking($order_id);

    /**
    * Get role
    *
    * @param int $id
    * @return Tomato_Core_Model_RecordSet
    */
    public function getRoleById($id);

    /**
    * Get customer
    *
    * @param int $userId
    * @return Tomato_Core_Model_RecordSet
    */
    public function getCustomerByUserId($userId);

    public function deleteOrderDetail($order_detail_id);

    /**
    * Add new order
    *
    * @param Tomato_Modules_Order_Models_Order $order
    * @return int
    */
    public function add($order);

    /**
    * Add new order detail
    *
    * @param array $order_detail
    * @return int
    */
    public function addDetail($order_detail);

    public function delete($order_id);

    public function editTrackingInfo($order_tracking);

    public function getOrderInfoById($order_id);

    /**
     * Get order by user
     * @param int $id Id of user
     * @return Tomato_Model_Recordset
    **/
    public function getOByU($id);

    /**
     * Get order detail by order id
     * @param int $order_id Id of order
     * @return Tomato_Models_Recordset
    **/
    public function getOrderDetails($order_id);

    /**================Front end========================*/
    public function updateInvoice($order);
}
